]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/theme-context: Warn instead of crashing on unsupported accent colors
authorDaniel van Vugt <daniel.van.vugt@canonical.com>
Fri, 26 Sep 2025 06:36:41 +0000 (14:36 +0800)
committerMarge Bot <marge-bot@gnome.org>
Wed, 1 Oct 2025 11:40:06 +0000 (11:40 +0000)
For example, Ubuntu's "brown". This is patched into gnome-shell for Ubuntu
but if you forget the patch then it's not worthy of a crash. Just pick a
colour and issue a warning.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3892>

src/st/st-theme-context.c

index 5b066d2696162a42ebd0562e811aaf9737daaa40..8007c38441b342d76ac98d92e25d13eeb8f1a3d2 100644 (file)
@@ -290,7 +290,9 @@ update_accent_colors (StThemeContext *context)
       break;
 
     default:
-      g_assert_not_reached ();
+      g_warning ("Unsupported accent color: %d", accent_color);
+      cogl_color_from_string (&context->accent_color, ACCENT_COLOR_BLUE);
+      break;
     }
 
   cogl_color_from_string (&context->accent_fg_color, ACCENT_FG_COLOR);